﻿namespace BM.Tools.WebControls.MForm.Controls.Additions.IdentityConstraints
{
    using System.Diagnostics.CodeAnalysis;

    using BM.Tools.WebControls.MForm.Controls.Helper;

    /// <summary>
    /// The internal control that is used to inform the item that it is a Key or a Key reference
    /// </summary>
    internal class BaseIdentity : Addition
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="BaseIdentity"/> class. 
        /// </summary>
        /// <param name="name">
        /// The name of the identity.
        /// </param>
        /// <param name="rootPath">
        /// The root path.
        /// </param>
        public BaseIdentity(string name, string rootPath)
        {
            Name = name;
            RootPath = rootPath;
        }

        /// <summary>
        /// Gets or sets the name of the identity.
        /// </summary>
        [AttributeProperty(Name = "name")]

        [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "It is used by the attribute property")]        
        public string Name
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the root path.
        /// </summary>
        [AttributeProperty(Name = "rootPath")]
        [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "It is used by the attribute property")]
        public string RootPath
        {
            get;
            set;
        }
    }
}